package lt.marsrutai.mobile.android.activity;

import lt.marsrutai.mobile.android.R;
import lt.marsrutai.mobile.android.fragment.StopBookmarksFragment;
import lt.marsrutai.mobile.android.fragment.TrackBookmarksFragment;
import lt.marsrutai.mobile.android.listener.BookmarkTabListener;

import com.actionbarsherlock.app.ActionBar;

public class BookmarkActivity extends BaseActivity {

    @Override
    protected void setupActionBar(final ActionBar actionBar) {
        super.setupActionBar(actionBar);

        actionBar.addTab(actionBar.newTab().setText(getString(R.string.stops))
                .setTabListener(new BookmarkTabListener<StopBookmarksFragment>(this, StopBookmarksFragment.class)));
        actionBar.addTab(actionBar.newTab().setText(getString(R.string.tracks_short))
                .setTabListener(new BookmarkTabListener<TrackBookmarksFragment>(this, TrackBookmarksFragment.class)));

        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle(getString(R.string.bookmarks));
    }

    @Override
    protected int getNavigationMode() {
        return ActionBar.NAVIGATION_MODE_TABS;
    }

    @Override
    public void setupView() {
        // Do not need to add fragment manually.
        // Correct fragment is added from the defined tab.
    }
}
